<template>
  <div class="main">
    <div class="container">
      <div v-for="(light, index) in lights" :key="index" class="light-item">
        <div class="light-icon">
          <img :src="light.icon" alt="Light Icon" width="30px" />
        </div>
        <div class="light-status">
          <div class="test">
            <div class="light-name">{{ light.name }}</div>
            <div class="brightness-value">{{ light.brightness }}%</div>
          </div>
          <div class="progress-container">
            <div class="progress-bar" :style="{ width: light.brightness + '%' }"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { reactive } from 'vue';
import light_icon from '@/assets/light_icon.png';
const lights = reactive([
      { name: 'Light 1', icon: light_icon, brightness: 60 },
      { name: 'Light 2', icon: light_icon, brightness: 80 },
      { name: 'Light 3', icon: light_icon, brightness: 45 },
      { name: 'Light 4', icon: light_icon, brightness: 60 },
    ]);
</script>

<style scoped>

.main {
  font-family: Arial, sans-serif;
  color: white !important;
  margin: 0;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.light-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.light-icon {
  width: 50px;
  height: 50px;
  background-color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.light-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.light-name {
  font-size: 16px;
}

.test {
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.progress-container {
  width: 200px;
  height: 10px;
  background-color: #444;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: #fff; /* Default background color */
  border-radius: 5px;
  background-image: linear-gradient(to right, #aaf7ff, #e5c1ff); /* Gradient background */
}

.brightness-value {
  font-size: 12px;
}
</style>
